/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package holdem.pokergui;

import javax.swing.ImageIcon;

/**
 *
 * @author Anders
 */
public class GuiCard {

    public final static int SPADES = 0, HEARTS = 1, DIAMONDS = 2, CLUBS = 3;
    public final static int ACE = 1, JACK = 11, QUEEN = 12, KING = 13;
    private final int suit, value;
    private static String[] SUIT = {"spade", "heart", "diamond", "club"};

    public GuiCard(int value, int suit) {
        this.value = value;
        this.suit = suit;
    }

    public int getSuit()
    {
        return suit;
    }

    public int getValue()
    {
        return value;
    }

    @Override
    public String toString() {
        return Integer.toString(suit) + Integer.toString(value);
    }

    public ImageIcon img()
    {
        return new ImageIcon(picSource());
    }

    public String picSource() {
        String ret = "200px-Playing_card_" + SUIT[suit] + "_";
	switch (value)
        {
            case 1: ret += "A"; break;
            case 11: ret += "J"; break;
            case 12: ret += "Q"; break;
            case 13: ret += "K"; break;
            default: ret += value;
	}
        ret += ".svg.png";
	return ret;
    }
}